<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>访问Web域对象：request_session_application | HttpServletRequest_HttpSession_ServletContext</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
  </head>
  
  <body>
  取得Map类型的request,session,application，真实类型的HttpServletRequest,HttpSession,ServletContext引用
  <ol>
  	<li>前三者：依赖于容器</li>
  	<li>前三者：<b>IOC【推荐使用】</b></li>
  	<li>后三者：依赖于容器</li>
  	<li>后三者：IOC</li>
  </ol>
  <br/>
  
  <form name"f" action="" method="post">
  用户名:<input type="text" name="username" />
  密码:<input type="password" name="password" />
  <p/>
  <input type="submit" value="submit_map" onclick="changeAction(this)" />
  <input type="submit" value="submit_mapAware" onclick="changeAction(this)" />
  <input type="submit" value="submit_http" onclick="changeAction(this)" />
  <input type="submit" value="submit_httpAware" onclick="changeAction(this)" />
  </form>
  <br/>
  
  <script type="text/javascript">
	function changeAction(inp){
		var sub = inp.value.substr(7);
		inp.form.action = "<%=basePath%>/webElements/loginAction_"+ sub + ".action";
		inp.form.submit();
	}  	
  </script>
  </body>
</html>
